﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using VQWEB.administrator.sources;
using VQData;

namespace VQWEB.administrator.english.excercises
{
    public partial class excercise_add : System.Web.UI.Page
    {
        EnglishData EnglishData = new EnglishData();
        eng_excercise eng_excercise = null;
        int Id = 0;
        protected void Page_Load(object sender, EventArgs e)
        {

            if (RouteData.Values["Id"] != null)
                int.TryParse(RouteData.Values["Id"].ToString(), out Id);
            if (Id > 0)
            {
                frmExcercise.DefaultMode = FormViewMode.Edit;
                eng_excercise = EnglishData.GetExcerciseById(Id);
                //news = NewsData.GetNewsById(Id);
                frmExcercise.DataSource = new List<eng_excercise> { eng_excercise };
                frmExcercise.DataBind();
            }
            else frmExcercise.DefaultMode = FormViewMode.Insert;
        }
    }

}